package com.hotel.mapper;

import com.hotel.domain.CheckIn;

import java.util.List;

import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

@Repository
public interface CheckInMapper {

    //查询所有登记信息
    @Select("select * from check_in ")
    List<CheckIn> findAllCheckIn();

/*

    CREATE TABLE `check_in` (
            `id` int(11) NOT NULL AUTO_INCREMENT,
  `room_id` int(4) DEFAULT NULL,
  `room_type` varchar(45) DEFAULT NULL,
  `startTime` datetime NOT NULL,
            `endTime` datetime DEFAULT NULL,
            `name` varchar(45) DEFAULT NULL,
  `tel_number` bigint(50) DEFAULT NULL,
  `people_type` int(4) DEFAULT NULL,
  `people_num` int(4) DEFAULT NULL,
  `price` int(11) DEFAULT NULL,
  `state` int(4) DEFAULT NULL,
    PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8
*/

    //添加登记信息
    @Insert("insert into check_in(room_id,room_type,startTime,tel_number,people_type,people_num,price) " +
            "values(#{roomId},#{roomType},#{starttime}#{telNumber},#{peopleType},#{peopleNum},#{price})"
            )
    void savecheckInfo(CheckIn checkIn);

}